package com.zhongge.comparerelevant.comparable;

/**
 * @ClassName Test
 * @Description TODO
 * @Author zhongge
 * @Version 1.0
 */
public class Test {
    public static void main(String[] args) {
        //创建3个学对象
        Student student1 = new Student("lisi", 16);
        Student student2 = new Student("zhangsan", 20);
        Student student3 = new Student("wanwu", 10);

        //天真的使用大于小于比较
//        System.out.println(student1 > student2);//报错

        if (student1.compareTo(student2) > 0) {
            System.out.println("student1 > student2");
        } else {
            System.out.println("student1 <= student2");
        }
    }
}
